<!-- BEGIN CONTENT -->
  <div class="col-md-9 col-sm-7">
	<div class="product-page">
	  <div class="row">
		<div class="col-md-6 col-sm-6">
		  <div class="product-main-image"><?php
			$img = $product->getImage();
			if(empty($img)):
				$img = $thumb = base_url('/assets/img/notfound.jpg');
			else:
				$thumb = base_url('/assets/upload/thumbs/'.$img->getName());
				$img = base_url('/assets/upload/'.$img->getName());
			endif;
			?><img src="<?php echo $thumb; ?>" alt="<?php echo html_escape($product->getName()); ?>" class="img-responsive" data-BigImgsrc="<?php echo $img; ?>">
		  </div>
		  <div class="product-other-images">
			<a href="../../assets/frontend/pages/img/products/model3.jpg" class="fancybox-button" rel="photos-lib"><img alt="Berry Lace Dress" src="../../assets/frontend/pages/img/products/model3.jpg"></a>
			<a href="../../assets/frontend/pages/img/products/model4.jpg" class="fancybox-button" rel="photos-lib"><img alt="Berry Lace Dress" src="../../assets/frontend/pages/img/products/model4.jpg"></a>
			<a href="../../assets/frontend/pages/img/products/model5.jpg" class="fancybox-button" rel="photos-lib"><img alt="Berry Lace Dress" src="../../assets/frontend/pages/img/products/model5.jpg"></a>
		  </div>
		</div>
		<div class="col-md-6 col-sm-6">
		  <h1><?php echo html_escape($product->getName()); ?></h1>
		  <div class="price-availability-block clearfix">
			<div class="price">
			  <strong><?php echo $product->getPrice(); ?><span>Đ</span></strong>
			</div>
			<div class="availability">
			  Tình trạng: <strong><?php
				if($product->getQuantity() == 0)
					echo 'Hết hàng';
				else
					echo 'Còn hàng';
			  ?></strong>
			</div>
		  </div><?php
		echo form_open('/carts/add_to_cart/'.$product->getId(),array(
			'class'=>'carts_form','role'=>'form'
		));
		  if(!empty($size) || !empty($color)):
		  ?><div class="product-page-options"><?php
			if(!empty($size)):
			?><div class="pull-left">
			  <label class="control-label">Size:</label>
			  <select name="size" class="form-control input-sm"><?php
				foreach($size as $v)
					echo '<option value="'.$v['id'].'">'.$v['val'].'</option>';
			  ?></select>
			</div><?php
			endif;
			if(!empty($color)):
			?><div class="pull-left">
			  <label class="control-label">Màu:</label>
			  <select name="color" class="form-control input-sm"><?php
				foreach($color as $v)
					echo '<option value="'.$v['id'].'">'.$v['name'].'</option>';
			  ?></select>
			</div><?php
			endif;
		  ?></div><?php
		  endif;

		  ?>
		  <div class="product-page-cart">
			<input type="hidden" name="name" value="<?php echo $product->getName(); ?>"/>
			<input type="hidden" name="price" value="<?php echo $product->getPrice(); ?>"/>
			<div class="product-quantity">
				
				<input id="product-quantity" name="qty" type="text" value="1" readonly class="form-control input-sm">
			</div>
			<button class="btn btn-primary" type="submit">Thêm vào giỏ hàng</button>
		  </div><?php
		  echo form_close();
		  ?><ul class="social-icons">
			<li><a class="facebook" data-original-title="facebook" href="#"></a></li>
			<li><a class="twitter" data-original-title="twitter" href="#"></a></li>
			<li><a class="googleplus" data-original-title="googleplus" href="#"></a></li>
			<li><a class="evernote" data-original-title="evernote" href="#"></a></li>
			<li><a class="tumblr" data-original-title="tumblr" href="#"></a></li>
		  </ul>
		</div>

		<div class="product-page-content">
		  <ul id="myTab" class="nav nav-tabs">
			<li class="active"><a href="#Description" data-toggle="tab">Miêu tả</a></li>
		  </ul>
		  <div id="myTabContent" class="tab-content">
			<div class="tab-pane fade in active" id="Description">
			  <p><?php echo html_escape($product->getContent()); ?></p>
			</div>
		  </div>
		</div>

	  </div>
	</div>
  </div>
  <!-- END CONTENT -->
  </div>
  
<!-- BEGIN SIMILAR PRODUCTS --><?php
if(!empty($similar)):
?><div class="row margin-bottom-40">
  <div class="col-md-12 col-sm-12">
	<h2>Sản phẩm tương tự</h2>
	<div class="owl-carousel owl-carousel4"><?php
	foreach($similar as $v):
		$img = $v->getImage();
		if(empty($img)):
			$img = $thumb = base_url('/assets/img/notfound.jpg');
		else:
			$thumb = base_url('/assets/upload/thumbs/'.$img->getName());
			$img = base_url('/assets/upload/'.$img->getName());
		endif;
	  ?><div>
		<div class="product-item">
		  <div class="pi-img-wrapper">
			<img src="<?php echo $thumb; ?>" class="img-responsive product-image full" alt="<?php echo html_escape($v->getName()); ?>">
			<div>
			  <a href="<?php echo $img; ?>" class="btn btn-default fancybox-button">Phóng to</a>
			</div>
		  </div>
		  <h3><a href="<?php echo base_url('/product/view/'.$v->getId()); ?>"><?php echo html_escape($v->getName()); ?></a></h3>
		  <div class="pi-price"><?php echo $v->getPrice(); ?> Đ</div>
		  <a href="#" class="btn btn-default add2cart">Thêm vào giỏ hàng</a>
		</div>
	  </div><?php
	endforeach;
	?></div>
  </div>
</div><?php
endif;
?>
<!-- END SIMILAR PRODUCTS -->